package com.mayikt.edu.controller;

import com.mayikt.edu.base.BaseApiController;
import com.mayikt.edu.base.BaseResponse;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class TestController extends BaseApiController {
  /**
   * 测试代码
   *
   * @return
   */
  @GetMapping("/test")
  public String test() {
    return "test";
  }

  @GetMapping("/test01")
  public BaseResponse test01() {
    return setResultSuccess();
  }

  @GetMapping("/test02")
  public BaseResponse test02(Integer age) {
    Integer j = 1 / age;
    return setResultSuccess();
  }

  @GetMapping("/test04")
  @ApiOperation(value = "测试传递参数", notes = "测试传递参数")
  @ApiImplicitParam(paramType = "query", name = "name", value = "传递name", required = true)
  public BaseResponse test04(String name) {
    log.info("name:{}", name);
    return setResultSuccess();
  }
}
